package com.example.xlmkotlinwanandroid.network

import androidx.lifecycle.MutableLiveData
import androidx.paging.DataSource

class ArticleDataFactory : DataSource.Factory<Int, ArticleResponse2.ArticleBean2>() {
    //创建1个livedata
    private val liveDataSource = MutableLiveData<ArticleDataSource>()
    override fun create(): DataSource<Int, ArticleResponse2.ArticleBean2> {
        val articleDataSource = ArticleDataSource()
        liveDataSource.postValue(articleDataSource)
        return articleDataSource
    }


}